package com.qige.homework;

public class JavaSE2 {
    public static void main(String[] args) {
        Dog dog = new Dog("旺财");
        dog.goPlay();
    }
}
abstract class Animal{
    public String name;
    void speak(String str){}
}
interface Sports{
    void swimming();
}
class Dog extends Animal implements Sports{
    public Dog(String name) {
        this.name = name;
    }
    @Override
    void speak(String str) {
        super.speak(str);
        System.out.println(name + "说：" + str);
    }

    @Override
    public void swimming() {
        System.out.println(name + "狗刨中！");
    }
    public void goPlay(){
        speak("我去玩了！");
        swimming();
    }
}
